package com.lill.system.serivce.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lill.common.component.util.IdUtil;
import com.lill.system.dao.ISysDomainDao;
import com.lill.system.model.SysDomainCompanyModel;
import com.lill.system.model.SysDomainEntity;
import com.lill.system.model.SysUserEntity;
import com.lill.system.service.ISysDomainService;

/**
 * 域对象Service实现类
 *
 * @author lill
 */
@Service("domainService")
public class SysDomainServiceImpl implements ISysDomainService {
    @Autowired
    private ISysDomainDao domainDao;

    public SysDomainEntity queryObject(String id) {
        return domainDao.queryObject(id);
    }

    public List<SysDomainEntity> queryList(Map<String, Object> map) {
        return domainDao.queryList(map);
    }

    public int queryTotal(Map<String, Object> map) {
        return domainDao.queryTotal(map);
    }

    public int save(SysDomainEntity domain,SysUserEntity user) {
        domain.setId(IdUtil.createIdbyUUID());
        domain.setCreateUser(user.getId());
        domain.setCreateTime(new Date());
        return domainDao.save(domain);
    }

    public int update(SysDomainEntity domain,SysUserEntity user) {
        domain.setUpdateUser(user.getId());
        domain.setUpdateTime(new Date());
        return domainDao.update(domain);
    }

    public int delete(String id) {
        return domainDao.delete(id);
    }

    public int deleteBatch(String[] ids) {
        return domainDao.deleteBatch(ids);
    }

	@Override
	public int deleteLogicByMap(Map<String, Object> params) {
		return domainDao.deleteLogicByMap(params);
	}

	@Override
	public List<SysDomainCompanyModel> queryUserAll(Map<String, Object> params) {
		return domainDao.queryUserAll(params);
	}
}
